<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('数据来源记录列表')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>渠道信息：</label>
                            <select name="infoId" class="form-control">
                                <option value="">所有</option>
                                <option th:each="item:${dataList}" th:text="${item.name}"
                                        th:value="${item.value}"></option>
                            </select>
                        </li>
                        <li>
                            <label>交易单号：</label>
                            <input type="text" name="id"/>
                        </li>
                        <li>
                            <label>外部订单号：</label>
                            <input type="text" name="outOrderNo"/>
                        </li>
                        <li>
                            <label>姓名：</label>
                            <input type="text" name="realName" placeholder="模糊查询"/>
                        </li>
                        <li>
                            <label>手机号：</label>
                            <input type="text" name="mobile"/>
                        </li>
                        <li>
                            <label>状态：</label>
                            <select name="status" class="form-control">
                                <option value="">所有</option>
                                <option value="1">推送成功</option>
                                <option value="2">撞库失败</option>
                                <option value="-1">无机构推送信息</option>
                                <option value="0">其他</option>
                            </select>
                        </li>
                        <li>
                            <label>推送机构ID：</label>
                            <input type="text" name="speInfoId"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('source:info:edit')}]];
    var removeFlag = [[${@permission.hasPermi('source:info:remove')}]];
    var prefix = ctx + "source/info";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "数据来源记录",
            columns: [
                //     {
                //     checkbox: true
                // },
                {
                    field: 'id',
                    title: '交易单号'
                },
                // {
                //     field: 'infoId',
                //     title: 'ID'
                // },
                {
                    field: 'outOrderNo',
                    title: '外部订单号'
                },
                {
                    field: 'infoName',
                    title: '渠道名称'
                },
                {
                    field: 'baseAmount',
                    title: '成本价格'
                },
                {
                    field: 'priceAmount',
                    title: '起推价格'
                },
                // {
                //     field: 'cityCode',
                //     title: '城市编码'
                // },
                // {
                //     field: 'province',
                //     title: '省份'
                // },
                // {
                //     field: 'city',
                //     title: '城市'
                // },

                // {
                //     field: 'provinceCode',
                //     title: '省编码'
                // },
                {
                    field: 'realName',
                    title: '用户信息',
                    formatter: function (value, row) {
                        var result = '';
                        if (row.realName != undefined) {
                            result = result + 'UID : ' + row.uid
                                + '<br>姓名 : ' + row.realName
                                + '<br>手机号 : ' + row.mobile;
                        }
                        return result;
                    }
                },
                // {
                //     field: 'mobile',
                //     title: '手机号'
                // },
                // {
                //     field: 'idCard',
                //     title: ''
                // },
                // {
                //     field: 'age',
                //     title: '年龄'
                // },
                // {
                //     field: 'sex',
                //     title: '性别',
                //     formatter: function (value, row) {
                //         if (value == 1) {
                //             return '男';
                //         } else
                //             return '女';
                //     }
                // },
                {
                    field: 'reqIp',
                    title: 'IP地址'
                },

                {
                    field: 'status',
                    title: '状态',
                    formatter: function (value, row) {
                        if (value === 1) {
                            return '成功';
                        } else if (value === 2) {
                            return "失败";
                        } else if (value === -1) {
                            return "无机构推送信息"
                        } else return value;
                    }
                },
                {
                    field: 'message',
                    title: '信息'
                },
                {
                    field: 'speInfoIdArr',
                    title: '可推机构'
                },
                // {
                //     field: 'uid',
                //     title: 'uid'
                // },
                {
                    field: 'speInfoId',
                    title: '推送机构ID'
                },
                {
                    field: 'pushPriceAmount',
                    title: '推送价格'
                },
                {
                    field: 'createTime',
                    title: '时间'
                },
                // {
                //     title: '操作',
                //     align: 'center',
                //     formatter: function(value, row, index) {
                //         var actions = [];
                //         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                //         actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                //         return actions.join('');
                //     }
                // }
            ]

        };
        $.table.init(options);
    });
</script>
</body>
</html>